<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/3/14
 * Time: 17:55
 */

namespace Home\Controller;


use Think\Controller;

class UserinfoController extends Controller
{
    public function index(){
        if(IS_POST){
            $Data = D('Data');
            $data = $Data->create();
            if($data){
                if($Data->add()){
                    $this->success("成功");
                }
                else{
                    $this->error("失败");
                }
            }
        }
        $team = D('Team')->join("lol_match on lol_team.match_id = lol_match.id")->order('lol_team.created_at desc')->field("lol_match.name mname,lol_team.id,lol_team.name")->select();
        $this->assign("team",$team);
        $this->display();
    }
}